<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddSendeamilToVulsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('vuls', function (Blueprint $table) {
            //
            $table->tinyInteger('checksend')->default('1')->comment('代表审核操作邮件是否已发送，默认为未发');
            $table->tinyInteger('shutsend')->default('1')->comment('代表关闭操作邮件是否已发送，默认为未发');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        if (Schema::hasColumn('vuls', 'checksend')) {
            Schema::table('vuls', function (Blueprint $table) {
                $table->dropColumn(['checksend']);
            });
        }
        if (Schema::hasColumn('vuls', 'shutsend')) {
            Schema::table('vuls', function (Blueprint $table) {
                $table->dropColumn(['shutsend']);
            });
        }
    }
}
